package com.glorysoft.tonglingxjpda.ui.function.adapter

import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.glorysoft.tonglingxjpda.R
import com.glorysoft.tonglingxjpda.base.DataBindBaseViewHolder
import com.glorysoft.tonglingxjpda.databinding.ItemDataCollectionTitleBinding
import com.glorysoft.tonglingxjpda.entity.EdcSetItemLineListEntity
import com.glorysoft.tonglingxjpda.entity.TempDataEntity

/**
 * FileName: DataCollectionAdapter
 * Author: XJH
 * Date: 2022/5/6 17:43
 * Description:
 * History:
 */
class DataCollectionAdapter(data: List<EdcSetItemLineListEntity>?) :
    BaseQuickAdapter<EdcSetItemLineListEntity, DataBindBaseViewHolder>(
        R.layout.item_data_collection_title, data
    ) {


    override fun convert(helper: DataBindBaseViewHolder, item: EdcSetItemLineListEntity) {
        val mBinding = helper.getDataBinding() as ItemDataCollectionTitleBinding
        mBinding.dataTitleItem = item
        val descAdapter = DataCollectionDescAdapter(item.EDCSETBINLINEVALUELIST)
        val rv : RecyclerView = helper.getView(R.id.rvDataDesc)
        rv.adapter = descAdapter
        mBinding.executePendingBindings()
    }
}